package csc.daonjpa.java.domain;

import java.io.Serializable;
import java.util.Collection;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "transactionState")
public class TransactionState implements Serializable {

	private static final long serialVersionUID = 1L;

	public static final Integer APPROVED_TRANSACTION = 1;
	public static final Integer PENDING_TRANSACTION = 2;
	public static final Integer DENIED_TRANSACTION = 3;
	
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@Column(name = "stateId")
	private Integer stateId;
	
	@Column(name = "statedescription")
	private String stateDescription;
	
	@OneToMany(mappedBy="transactionState")
	private Collection<Transaction> transaction;

	public Integer getStateId() {
		return stateId;
	}

	public void setStateId(Integer stateId) {
		this.stateId = stateId;
	}

	public String getStateDescription() {
		return stateDescription;
	}

	public void setStateDescription(String stateDescription) {
		this.stateDescription = stateDescription;
	}

	public Collection<Transaction> getTransaction() {
		return transaction;
	}

	public void setTransaction(Collection<Transaction> transaction) {
		this.transaction = transaction;
	}

	public TransactionState() {
		super();
	}

	public TransactionState(Integer stateId, String stateDescription,
			Collection<Transaction> transaction) {
		super();
		this.stateId = stateId;
		this.stateDescription = stateDescription;
		this.transaction = transaction;
	}
	
}
